<template>
	<view>
		<view class="pl-30 pr-30 pt-30" v-for="(item, index) in inviteList" :key="index"
			@click="$goRoute.goUrl('/pages/lists/details?id='+item.id)">
			<view class="bg-white pl-20 pr-20 pt-30 pb-30 border-radius">
				<view class="flex space-between flex-align-end">
					<view class="font-bold font-30">{{item.name}}</view>
					<view class="font-26 font-g font-bold">{{item.payLow}}-{{item.payHigh}}</view>
				</view>
				<view class="flex font-26 mt-20">
					<view>{{item.companyId_dictText}}</view>
					<!-- <view class="ml-40">2000-5000人</view> -->
				</view>
				<view class="flex font-22 mt-10" style="color: #686E6E;">
					<view class="pt-10 pb-10 pl-30 pr-30">{{item.jobNature}}</view>
					<view class="pt-10 pb-10 pl-30 pr-30">{{item.peopleNum}}人</view>
					<view class="pt-10 pb-10 pl-30 pr-30">{{item.education_dictText}}</view>
					<view class="pt-10 pb-10 pl-30 pr-30">{{item.experience}}</view>
				</view>
				<view class="flex space-between items-center mt-10">
					<view class="flex items-center">
						<image src="../../../static/images/avatar.png" mode=""
							style="width: 50rpx;height: 50rpx;border-radius: 50%;"></image>
						<view class="font-24 ml-10">{{item.hruserId_dictText}}</view>
					</view>
					<view class="font-24">{{item.city}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		list
	} from '../../../api/invite';
	export default {
		data() {
			return {
				height: 0,
				statusBarHeight: 0,
				navBarHeight: 0,
				searchWords: '',
				selectIndex: 0,
				array: ['东营区', '河口区', '利津县', '广饶县'],
				index: 0,
				pageSize: 10,
				pageNo: 1,
				inviteList: []
			};
		},
		onLoad() {
			this.getHeight()
			this.getInviteList()
		},
		methods: {
			getInviteList() {
				uni.showLoading({
					title: '加载中'
				})
				list({
					pageSize: this.pageSize,
					pageNo: this.pageNo,
				}).then(res => {
					if (this.pageNo === 1) {
						this.inviteList = res.result.records
					} else {
						this.inviteList.push(...res.result.records)
					}
					this.pageNo += 1
					uni.hideLoading()
				})
			},
			bindPickerChange: function(e) {
				this.index = e.detail.value
				this.search()
			},
			search() {
				uni.showLoading({
					title: '加载中...'
				})
				setTimeout(() => {
					uni.hideLoading()
				}, 1000)
			},
			setIndex(index) {
				this.selectIndex = index
				this.search()
			},
			//获取屏幕导航栏高度
			getHeight() {
				if (wx.canIUse('getMenuButtonBoundingClientRect')) {
					let sysInfo = wx.getSystemInfoSync(); //状态栏的高度
					this.statusBarHeight = sysInfo.statusBarHeight;
					// 胶囊位置信息
					let rect = wx.getMenuButtonBoundingClientRect();
					this.menuButtonRect = JSON.parse(JSON.stringify(rect));
					// 导航栏高度
					let navBarHeight = (rect.top - sysInfo.statusBarHeight) * 2 + rect.height;
					this.navBarHeight = navBarHeight;
					// 自定义导航栏的高度
					this.height = sysInfo.statusBarHeight + navBarHeight;
				} else {
					wx.showToast({
						title: '您的微信版本过低，界面可能会显示不正常',
						icon: 'none',
						duration: 4000
					});
				}
			},
		}
	}
</script>

<style lang="less">
	page {
		background-color: #F6F6F6;
	}

	.nav-box {
		background-color: #46b4b1;
		position: sticky;
		top: 0;
		z-index: 9999;

		.search-input {
			background-color: rgba(255, 255, 255, .8);
			height: 30px;
			display: flex;
			align-items: center;
			border-radius: 50rpx;
			padding: 0 30rpx;
		}
	}

	.list-bord {
		background: #fff;
		width: 68rpx;
		height: 8rpx;
	}
</style>